TECHNICAL INTERVIEW WITH TCS

Me:   May I come in sir.

TP:    Come in and sit.      
                                                 							// TP is Technical Person
Me:   Thankyou sir.

TP:    Tell me about yourself  ?

Me:    I am Akhil Kumar Soni ...........................................................

TP:     You have said , you learn memory techniques , what are they?

Me:    Sir , memory techniques help me to memorize and learn faster.There are various methods in this techniques:
          > Journey Method
         >Personal Meaning System(PMS) method
 ( He doesnot ask me anything more on this.)

TP:     Ok, you have done mini project on Database Handling and executing Queries through C .
          So how you have connected database through C ?

Me:    Sir, I have not connected the database through C , we were told to create database in C using file handling and 
          make queries in C only to access that database .

TP:     Your area of interest is Data Structures through C , so what have you studied in this subject ? 

Me:     Sir , I have studied stacks , queues, linklists , sorting algorithms , trees and graphs.

TP:     In sorting algorithm what all you have studied ?

Me:    Sir, I have studied insertion sort , selection sort , quick sort , bubble sort , heapsort.

(Then he gave me an array of integers )

TP:     Sort this array using quick sort algorithm.

Me:    Sir , quick sort algorithm works on the divide and conquer approach , we divide array in parts .As I have studied 
          this in previous semesters , I am not able to recall at the moment but I can sort this array with any other algorithm.

TP:     Do it with selection sort and show me in step-by-step.

Me:    Right sir .( I shown him the sorting of  array in step-by-step process)

TP:     Write a program to print this 
				 *
				 * *
				 * * * 
Me:    ( This was a simple program , no problem for me ).
	
	#include<stdio.h>
	main()
	{
	   int i,j;
	   for(i=0;i<3;i++)
	    {
	         printf(" \n");
	         for(j=0;j<i;j++)
	         {
              printf(" * ");
	         }
         }
      }

TP:     What are constructors in C++ ?

Me:     Sir , Constructors are member function having same name as its class and it executes automatically .
           We basically do initialization in the constructor.

TP:     What are the  types of constructors ?

Me:     Sir , the types of constructors are...(I took a pause for a moment as I don't know the answer )

TP:     ( interrupting me ) Have you heared about the copy constructor ?

Me:    Yes sir.

TP:     It is a type of constructor.What is copy constructor ?

Me:    Sir , I have studied about the copy constructor but right now I am not able to recall it.
          Actually sir I am studying C++ with my own. We don't have it in our syallabus.

( After that he does't ask me any more questions on C++ )

TP:    What is difference between break and continue ?

Me:    Sir , break keyword moves the control out of any loop immediately and continue transfer control back to the loop.

TP:    What is output of the following :  
	
	for(i=0;i<10;i++)
	{
	 if(!0)
	 { 
	    break;
	    printf("%d",i) ;
	 }
	}

Me:   Sir , it will not print anything as break moves control out of the loop.

(Then he shift break below and ask me again )

TP:    What is output of this:
	
	for(i=0;i<10;i++)
	{
	 if(!0)
	 { 
	   
	    printf("%d",i) ;
	    break;
	 }
	}

Me:   Sir , it will print 0 and moves out of the loop.

(Then he replace break with continue )

TP:   Ok . Now what is the output : 
	
	for(i=0;i<10;i++)
	{
	 if(!0)
	 { 
	    continue;
	    printf("%d",i) ;
	 }
	}

Me:    Sir , it will not print anything as continue transfer control back to loop.

TP :   What is output of this :
	
	for(i=0;i<10;i++)
	{
	 if(!0)
	 { 
	       printf("%d",i) ;
	       continue;
	 }
	}

Me:   Sir it will print 0 1 2 ......... upto 9.

( I have answered all of them confidently and correctly ).

TP:    Ok , Akhil you may go now .

Me:    Thankyou sir.

So friends this was all.

I would like to suggest you all few things :

     - Tell them only that things in which you are comfortable .I have done mistake by telling him about the quick sort ,
      the algo which I am not comfortable with but luckily I managed to get that. 

      - Don't use " I don't know the answer " it is a very negative term .Instead you can say- " I am not able to recall it 
       right  now"  or " I am not comfortable in this area ".

      - Don't answer immediately , take your time ( means just few seconds ).

 I was happy as I have answered many questions correctly .And I was confidant too that I will be called for HR interview.

And next what happen , one of my friend that came out from the HR cabin told  me -" Akhil next call is yours ".

Best of luck to all of you. Hope it will help you.

Akhil